package com.psp.web.persist.dao;

import java.util.List;
import java.util.Set;

import com.psp.web.model.AddressBean;

public interface AddressDao {

	int insert(AddressBean bean);

	int update(AddressBean bean);

	AddressBean selectById(String aid);

	/**
	 * 通过 aid 批量查询用户的地址
	 * 
	 * @param addressIds
	 * @return
	 */
	List<AddressBean> selectByIds(Set<String> aids);

	int selectCount(String uid, int type);

	List<AddressBean> selectList(int page, int pageSize, String uid, int type);

	int deleteById(String aid, String uid);

	/**
	 * 更新默认的
	 * 
	 * @param uid
	 *            条件值
	 * @param type
	 *            条件值
	 * @param isDefault
	 *            更新字段 0表示非默认 1表示默认
	 * @return
	 */
	int updateDefault(String uid, Integer type, Integer isDefault);

	/**
	 * 获取用户的默认地址
	 * 
	 * @param uid
	 * @param isDefault
	 * @return
	 */
	AddressBean selectDefault(String uid, Integer isDefault);

}
